<?php include "../../layout/header.php";?>
<script type="text/javascript" src="<?php echo($siteroot);?>js/shop/cartControl.js"></script>
<script type="text/javascript" src="<?php echo($siteroot);?>js/shop/search.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
	loadpage(1);
});
-->
</script>
<link rel="stylesheet" href="<?php echo($siteroot);?>css/shop.css" type="text/css" />
<?php include "../../layout/navleft.php"; ?>
<div id="content_small">
    <div class="container_brown">
        <font face="Verdana" color = brown size = 2.5px> <a href="mainShop.php" >Store</a></font>
        <font face="Verdana" color =brown size = 2.5px> > Item Shop</font>
        <br><br>
		<?php
		if(!isset($_SESSION['logged_in'])){?>
			<p class="main_shop_head">Please sign in.</p>
		<?php } ?>
		
		<div id="item_category">		
	        <form id="item_list">
	            <select id="item_list_select" onchange="loadpage(1)">
	            <option value="all">All</option>
        <?php 
        include "../../db/dbconnect.php";
        
        $query = "SELECT * FROM item_category ";
		$result = mysql_query($query);
		if($result) $dbrow = mysql_num_rows($result);
		else $dbrow = 0;
		
		if($dbrow > 0){
		    while($row = mysql_fetch_array($result))
		    {
		    	$key = $row['item_cat_id'];
		    	$value = $row['cat_name'];
		?>
				<option value="<?php echo($key);?>"><?php echo($value);?></option>
	            <!--<option value="0">Shirts</option>
	            <option value="1">Shoes</option>
	            <option value="2">Weapon</option>-->
	    <?php
		    }
		}
	    ?>
	            </select>
        	</form>
        </div>
        <div id="item_search">
        	<input id="item_search_text" type ="text" valign="middle" size ="10">
        	<input id="item_search_button" type="image" valign="middle" src="<?php echo($siteroot);?>images/shop/searchbutton.jpg">
        </div>
		<table id="shop_table">
			<tr>
				<td>
					<div id="shop_div">
						<table id="mainTable"></table>
					</div>
				</td>
			</tr>
		</table>
        <div id="page_selector"></div>
    </div>
</div>
<?php include "simpleShoppingCart.php"; ?>
<?php include "inventory.php";?>
<?php include "../../layout/footer.php"; ?>